package com.xcc.annotation.ioc.config;

import com.xcc.annotation.ioc.bean.Cat;
import com.xcc.annotation.ioc.bussines.MyDogService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;

/**
 * 测试ComponentScan
 */
@ComponentScan(value = {"com.xcc.annotation.ioc.bussines"}, includeFilters = {
        @ComponentScan.Filter(type = FilterType.ANNOTATION, value = {Controller.class}),//按照注解
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = {MyDogService.class}),//按照类型
        @ComponentScan.Filter(type = FilterType.CUSTOM,value = {Demo01_MyTypeFilter.class} )
}, useDefaultFilters = false)
public class Demo01_ComponentScan {


    @Bean
    public Cat cat() {
        return new Cat(1, "444");
    }

}
